﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Input;
using System.Reflection;
using Kokomo.Mirror.CliMetadata;

namespace Kokomo.PeInspector.Reflection
{
	/// <summary>
	/// Provides functionality for managing an assembly list.
	/// </summary>
	/// <remarks>
	/// The implementation is provided by <see cref="IMetadataHost.AssemblyListHost"/>.
	/// </remarks>
	public interface IAssemblyListHost
	{
		/// <summary>
		/// Gets the list of assemblies.
		/// </summary>
		AssemblyList AssemblyList { get; }
		DependencyIndex DependencyIndex { get; }
		/// <summary>
		/// Gets the <c>Add to Favorites</c> command.
		/// </summary>
		ICommand AddFavoriteCommand { get; }
		/// <summary>
		/// Gets the <c>Remove Assembly</c> command.
		/// </summary>
		ICommand RemoveAssemblyCommand { get; }
		/// <summary>
		/// Gets the <see cref="AssemblyIndex"/> corresponding to a given assembly.
		/// </summary>
		/// <param name="assembly">The assembly.</param>
		/// <returns>The <see cref="AssemblyIndex"/> for <paramref name="assembly"/>.</returns>
		/// <exception cref="ArgumentNullException"><paramref name="assembly"/> is <c>null</c>.</exception>
		/// <remarks>
		/// The initial call to this method creates the index.
		/// Subsequent calls return this same index.
		/// </remarks>
		/// <seealso cref="AssemblyIndex"/>
		AssemblyIndex GetAssemblyIndex(Assembly assembly);
		/// <summary>
		/// Gets the context for loading assemblies.
		/// </summary>
		/// <remarks>
		/// Use this load context when loading assemblies, rather
		/// than Reflection.
		/// </remarks>
		IAssemblyLoadContext LoadContext { get; }
	}
}
